#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>
bool ex(int mid)
{
    int qe = mid;
    while (mid > 0)
    {
        int q = mid % 10;
        if (q == 0 || qe % q != 0)
        {
            return false;
        }
        else
            mid /= 10;
    }
    return true;
}

int* selfDividingNumbers(int left, int right, int* returnSize)
{
    int* arr = (int*)malloc(sizeof(int) * (right - left));
    int k = 0;
    for (int i = left; i <= right; i++)
    {

        if (ex(i))
            arr[k++] = i;
    }
    *returnSize = k;
    return arr;
}